/**
 * Created by asus on 2017/10/15.
 */
public class Myqueue<T> {
    private int size;
    private point firstpoint;
    private point endpoint;

    class point{
        T data;
        point front;


        public point(T data,point front){
            this.data = data;
            this.front = front;
        }
    }
    public Myqueue(){
        size=0;
        firstpoint=new point(null,null);
        endpoint=new point(null,null);

    }
    public void enqueue(T element){
        point now = new point(element,null);
        if (size==0)
        { firstpoint=now;
            endpoint=now;}
        else
            endpoint.front=now;
        endpoint=now;
        size++;


    }
    public T dequeue(){
        point now = new point(null,null);
        now.data=firstpoint.data;
        firstpoint=firstpoint.front;
        size--;
        return now.data;
    }
    public boolean isEmpty(){
        if (size==0)
            return true;
        else return false;
    }

}
